{extend name="base" /}
{block name="title"}保险录入{/block}
{block name="bread"}
<div class="bread-cram">
    <div class="bread-cram-inner">
        <span class="title">保险公司使用</span>
        <span class='sub-title'>- 保险录入</span>
    </div>
</div>
{/block}
{block name="main"}
          <div class="menu-content left">
            <div class="menu-content-title"><p>资料录入</p></div>
            <div class="step-box">
              <div class="active">保单险种</div>
              <div class="active">货品信息</div>
              <div class="active">货品受损</div>
              <div class="active">货品现状</div>
              <div class="active">物权信息</div>
              <div>递交授权</div>
            </div>
            <div class="msg-tip" style="text-align: center">
              *以下资料作为法律责任依据请如实填写,<a>查看模板>></a>
            </div>
            <div class="form-box">
                <div class="form-content">
                    <div class="form-item">
                        <label>要求在：</label>
                            <input type="text" placeholder="请选择时间" class="time" id="should_at"/> 前处置完成
                        </div>
                    <div class="form-item">
                        <label>物权单位：</label>
                        <input type="text" placeholder="请填写单位名称" name="rem_company" />
                    </div>
                    <div class="form-item">
                        <label>联系人：</label>
                        <input type="text" placeholder="请填写联系人名称" name="linkman"/>
                    </div>
                    <div class="form-item">
                        <label>手机号：</label>
                        <input type="text" placeholder="请填写手机号"  name="connect_phone"/>
                    </div>
                </div>
                <div class="form-footer">
                    <div class="step-btn-box">
                        <div class="pre-btn" onclick="javascript:history.go(-1);">上一步</div>
                        <div class="next-btn">下一步</div>
                    </div>
                </div>
            </div>
          </div>
<input type="hidden" value="{$policy_num}" name='policy_num'/>
{/block}


{block name="js"}
<script type="text/javascript">
    $(function() {
        var laydate = layui.laydate;
        //常规用法
        laydate.render({
            elem: '#should_at'
        });
        $('.next-btn').on('click',function(){
            var poliecy = $("input[ name='policy_num']").val();
            var should_at = $("#should_at").val()
            var rem_company = $("input[ name='rem_company']").val();
            var linkman = $("input[ name='linkman']").val();
            var connect_phone = $("input[ name='connect_phone']").val();
           // location.href= "{:url('insurer/step6')}";
            $.ajax({
                type: 'POST',
                url: "{:url('insurer/addInsurer')}",
                data: {
                    'policy_num': poliecy,
                    'should_at': should_at,
                    'rem_company': rem_company,
                    'linkman': linkman,
                    'connect_phone': connect_phone,
                    'now_status': 5
                },
                dataType: 'json',
                success: function (Json) {
                    if (Json.code == 200) {
                        location.href = "{:url('insurer/step6')}?policy_num=" + Json.data.policy_num;
                    } else {
                        layer.msg(Json.msg, {icon: 2});
                    }
                }
            });
        });


    })



</script>
{/block}